package com.baimawangzi.recovery.util.dbutil;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 * 只返回一行一列的
 *
 */
public class OnlyHandler implements ResultHandler<Object>{
    @Override
    public List<Object> handler(ResultSet rs) {

        try {
            if (rs.next()){
                Object value = rs.getObject(1);
                System.out.println(value);
                ArrayList<Object> arrayList = new ArrayList<>();
                arrayList.add(value);
                return arrayList;

            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
